home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------------------------------
- // SimpleStatusBarWithPanel.cs ⌐ 2001 by Charles Petzold
- //-------------------------------------------------------
- using System;
- using System.Drawing;
- using System.Windows.Forms;
-
- class SimpleStatusBarWithPanel: Form
- {
- public static void Main()
- {
- Application.Run(new SimpleStatusBarWithPanel());
- }
- public SimpleStatusBarWithPanel()
- {
- Text = "Barra de estado simple con un panel";
-
- // Crea un panel.
-
- Panel panel = new Panel();
- panel.Parent = this;
- panel.BackColor = SystemColors.Window;
- panel.ForeColor = SystemColors.WindowText;
- panel.AutoScroll = true;
- panel.Dock = DockStyle.Fill;
- panel.BorderStyle = BorderStyle.Fixed3D;
-
- // Crea una barra de estado como control secundario del formulario.
-
- StatusBar sb = new StatusBar();
- sb.Parent = this;
- sb.Text = "Mi primer texto en la barra de estado";
-
- // Crea etiquetas como controles secundarios del panel.
-
- Label label = new Label();
- label.Parent = panel;
- label.Text = "Superior izquierda";
- label.Location = new Point(0, 0);
-
- label = new Label();
- label.Parent = panel;
- label.Text = "Inferior derecha";
- label.Location = new Point(250, 250);
- label.AutoSize = true;
- }
- }
-